package com.itheima.Test;

import java.util.Scanner;

public class LoopTest03 {
    public static void main(String[] args) {
        System.out.println("请输入一个整数：");
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();
        boolean flag = true;
        for (int i = 2; i <= number - 1 ; i++) {
            if(number % i == 0) {
                flag = false;
                break;
            }
        }
        if(flag) {
            System.out.println(number + "是一个质数");
        } else {
            System.out.println(number + "不是一个质数");
        }
    }

}
